 package client.inventory;

 import client.MapleCharacter;
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonProperty;
 import configs.CubeConfig;
 import configs.ServerConfig;
 import configs.StarForceConfig;
 import constants.GameConstants;
 import constants.ItemConstants;
 import constants.JobConstants;
 import handling.channel.handler.ItemScrollHandler;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 import server.MapleInventoryManipulator;
 import server.MapleItemInformationProvider;
 import server.StructItemOption;
 import tools.DateUtil;
 import tools.Randomizer;
 import tools.packet.InventoryPacket;

 public class Equip extends Item implements Serializable {
   public static final long ARMOR_RATIO = 350000L;
   public static final long WEAPON_RATIO = 700000L;
   private static final long serialVersionUID = -4385634094556865314L;
/*   29 */   private byte upgradeSlots = 0; private byte level = 0; private byte vicioushammer = 0; private byte state = 0; private byte enhance = 0; private byte addState;
/*   30 */   private short enhanctBuff = 0; private short reqLevel = 0; private short yggdrasilWisdom = 0; private short bossDamage = 0; private short ignorePDR = 0; private short totalDamage = 0; private short allStat = 0; private short karmaCount = -1;
   private boolean finalStrike = false;
/*   32 */   private short str = 0; private short dex = 0; private short _int = 0; private short luk = 0; private short hp = 0; private short mp = 0; private short watk = 0; private short matk = 0; private short wdef = 0; private short mdef = 0; private short acc = 0; private short avoid = 0; private short hands = 0; private short speed = 0; private short jump = 0; private short charmExp = 0; private short pvpDamage = 0;
/*   33 */   private int durability = -1, incSkill = -1, statemsg = 0;
/*   34 */   private int potential1 = 0, potential2 = 0, potential3 = 0, potential4 = 0, potential5 = 0, potential6 = 0;
/*   35 */   private int socket1 = -1, socket2 = -1, socket3 = -1;
/*   36 */   private int itemSkin = 0;
/*   37 */   private long limitBreak = 0L; private long limitBreakEx;
/*   38 */   private MapleRing ring = null;
/*   39 */   private MapleAndroid android = null;

/*   41 */   private int lockSlot = 0;
/*   42 */   private short lockId = 0;
/*   43 */   private byte sealedLevel = 0;
/*   44 */   private long sealedExp = 0L; private long itemEXP = 0L; private long fire = -1L; private short soulname; private short soulenchanter;
   private short soulpotential;
/*   46 */   private int soulSkill = 0;
/*   47 */   private Map<EquipStats, Long> statsTest = new LinkedHashMap<>();
   private int iIncReq;
/*   49 */   private NirvanaFlame nirvanaFlame = new NirvanaFlame();
/*   50 */   private int bonus = 0;
   private short ARC;
   private int ARCExp;
/*   53 */   private short ARCLevel = 1;

/*   55 */   private int itemState = 256;



   @JsonCreator
   public Equip(@JsonProperty("id") int id, @JsonProperty("position") short position, @JsonProperty("flag") short flag) {
/*   61 */     super(id, position, (short)1, flag);
   }

   public Equip(int id, short position, int uniqueid, short flag, short espos) {
/*   65 */     super(id, position, (short)1, flag, uniqueid, espos);
   }


   public Item copy() {
/*   70 */     Equip ret = new Equip(getItemId(), getPosition(), getUniqueId(), getFlag(), getESPos());
/*   71 */     ret.str = this.str;
/*   72 */     ret.dex = this.dex;
/*   73 */     ret._int = this._int;
/*   74 */     ret.luk = this.luk;
/*   75 */     ret.hp = this.hp;
/*   76 */     ret.mp = this.mp;
/*   77 */     ret.matk = this.matk;
/*   78 */     ret.mdef = this.mdef;
/*   79 */     ret.watk = this.watk;
/*   80 */     ret.wdef = this.wdef;
/*   81 */     ret.acc = this.acc;
/*   82 */     ret.avoid = this.avoid;
/*   83 */     ret.hands = this.hands;
/*   84 */     ret.speed = this.speed;
/*   85 */     ret.jump = this.jump;
/*   86 */     ret.upgradeSlots = this.upgradeSlots;
/*   87 */     ret.level = this.level;
/*   88 */     ret.itemEXP = this.itemEXP;
/*   89 */     ret.durability = this.durability;
/*   90 */     ret.vicioushammer = this.vicioushammer;
/*   91 */     ret.state = this.state;
/*   92 */     ret.addState = this.addState;
/*   93 */     ret.enhance = this.enhance;
/*   94 */     ret.potential1 = this.potential1;
/*   95 */     ret.potential2 = this.potential2;
/*   96 */     ret.potential3 = this.potential3;
/*   97 */     ret.potential4 = this.potential4;
/*   98 */     ret.potential5 = this.potential5;
/*   99 */     ret.potential6 = this.potential6;
/*  100 */     ret.charmExp = this.charmExp;
/*  101 */     ret.pvpDamage = this.pvpDamage;
/*  102 */     ret.incSkill = this.incSkill;
/*  103 */     ret.statemsg = this.statemsg;
/*  104 */     ret.socket1 = this.socket1;
/*  105 */     ret.socket2 = this.socket2;
/*  106 */     ret.socket3 = this.socket3;
/*  107 */     ret.itemSkin = this.itemSkin;
/*  108 */     ret.limitBreak = this.limitBreak;


/*  111 */     ret.enhanctBuff = this.enhanctBuff;
/*  112 */     ret.reqLevel = this.reqLevel;
/*  113 */     ret.yggdrasilWisdom = this.yggdrasilWisdom;
/*  114 */     ret.finalStrike = this.finalStrike;
/*  115 */     ret.bossDamage = this.bossDamage;
/*  116 */     ret.ignorePDR = this.ignorePDR;
/*  117 */     ret.totalDamage = this.totalDamage;
/*  118 */     ret.allStat = this.allStat;
/*  119 */     ret.karmaCount = this.karmaCount;
/*  120 */     ret.statsTest = this.statsTest;

/*  122 */     ret.setGMLog(getGMLog());
/*  123 */     ret.setGiftFrom(getGiftFrom());
/*  124 */     ret.setOwner(getOwner());
/*  125 */     ret.setQuantity(getQuantity());
/*  126 */     ret.setExpiration(getExpiration());
/*  127 */     ret.setInventoryId(getInventoryId());
/*  128 */     ret.setEquipOnlyId(getEquipOnlyId());

/*  130 */     ret.lockSlot = this.lockSlot;
/*  131 */     ret.lockId = this.lockId;
/*  132 */     ret.sealedLevel = this.sealedLevel;
/*  133 */     ret.sealedExp = this.sealedExp;

/*  135 */     ret.soulname = this.soulname;
/*  136 */     ret.soulenchanter = this.soulenchanter;
/*  137 */     ret.soulpotential = this.soulpotential;
/*  138 */     ret.soulSkill = this.soulSkill;
/*  139 */     ret.fire = this.fire;
/*  140 */     ret.nirvanaFlame = this.nirvanaFlame;
/*  141 */     ret.ARC = this.ARC;
/*  142 */     ret.ARCExp = this.ARCExp;
/*  143 */     ret.ARCLevel = this.ARCLevel;

/*  145 */     return ret;
   }

   public Item inherit(Equip srcEquip, Equip decEquip) {
/*  149 */     this.str = (short)(this.str + (short)(srcEquip.str - decEquip.str));
/*  150 */     this.dex = (short)(this.dex + (short)(srcEquip.dex - decEquip.dex));
/*  151 */     this._int = (short)(this._int + (short)(srcEquip._int - decEquip._int));
/*  152 */     this.luk = (short)(this.luk + (short)(srcEquip.luk - decEquip.luk));
/*  153 */     this.hp = (short)(this.hp + (short)(srcEquip.hp - decEquip.hp));
/*  154 */     this.mp = (short)(this.mp + (short)(srcEquip.mp - decEquip.mp));
/*  155 */     this.matk = (short)(this.matk + (short)(srcEquip.matk - decEquip.matk));
/*  156 */     this.mdef = (short)(this.mdef + (short)(srcEquip.mdef - decEquip.mdef));
/*  157 */     this.watk = (short)(this.watk + (short)(srcEquip.watk - decEquip.watk));
/*  158 */     this.wdef = (short)(this.wdef + (short)(srcEquip.wdef - decEquip.wdef));
/*  159 */     this.acc = (short)(this.acc + (short)(srcEquip.acc - decEquip.acc));
/*  160 */     this.avoid = (short)(this.avoid + (short)(srcEquip.avoid - decEquip.avoid));
/*  161 */     this.hands = (short)(this.hands + (short)(srcEquip.hands - decEquip.hands));
/*  162 */     this.speed = (short)(this.speed + (short)(srcEquip.speed - decEquip.speed));
/*  163 */     this.jump = (short)(this.jump + (short)(srcEquip.jump - decEquip.jump));
/*  164 */     this.upgradeSlots = srcEquip.upgradeSlots;
/*  165 */     this.level = srcEquip.level;
/*  166 */     this.itemEXP = srcEquip.itemEXP;
/*  167 */     this.durability = srcEquip.durability;
/*  168 */     this.vicioushammer = srcEquip.vicioushammer;
/*  169 */     this.enhance = srcEquip.enhance;
/*  170 */     this.charmExp = srcEquip.charmExp;
/*  171 */     this.pvpDamage = srcEquip.pvpDamage;
/*  172 */     this.incSkill = srcEquip.incSkill;
/*  173 */     this.limitBreak = srcEquip.limitBreak;
/*  174 */     this.enhanctBuff = srcEquip.enhanctBuff;
/*  175 */     this.reqLevel = srcEquip.reqLevel;
/*  176 */     this.yggdrasilWisdom = srcEquip.yggdrasilWisdom;
/*  177 */     this.finalStrike = srcEquip.finalStrike;
/*  178 */     this.bossDamage = srcEquip.bossDamage;
/*  179 */     this.ignorePDR = srcEquip.ignorePDR;
/*  180 */     this.totalDamage = srcEquip.totalDamage;
/*  181 */     this.allStat = srcEquip.allStat;
/*  182 */     this.karmaCount = srcEquip.karmaCount;
/*  183 */     this.fire = srcEquip.fire;
/*  184 */     this.nirvanaFlame = new NirvanaFlame(srcEquip.nirvanaFlame);
/*  185 */     this.soulname = srcEquip.soulname;
/*  186 */     this.soulenchanter = srcEquip.soulenchanter;
/*  187 */     this.soulpotential = srcEquip.soulpotential;
/*  188 */     this.sealedLevel = srcEquip.sealedLevel;
/*  189 */     this.sealedExp = srcEquip.sealedExp;
/*  190 */     setGiftFrom(getGiftFrom());
/*  191 */     copyPotential(srcEquip);
/*  192 */     return this;
   }


   public byte getType() {
/*  197 */     return 1;
   }

   public Equip copyPotential(Equip equip) {
/*  201 */     this.potential1 = equip.potential1;
/*  202 */     this.potential2 = equip.potential2;
/*  203 */     this.potential3 = equip.potential3;
/*  204 */     this.potential4 = equip.potential4;
/*  205 */     this.potential5 = equip.potential5;
/*  206 */     this.potential6 = equip.potential6;
/*  207 */     this.state = equip.state;
/*  208 */     this.addState = equip.addState;
/*  209 */     return this;
   }

   public byte getUpgradeSlots() {
/*  213 */     return this.upgradeSlots;
   }

   public void setUpgradeSlots(byte upgradeSlots) {
/*  217 */     this.upgradeSlots = upgradeSlots;
   }

   public short getStr() {
/*  221 */     return (short)(this.str + this.nirvanaFlame.getNstr());
   }

   public short getAloneStr() {
/*  225 */     return this.str;
   }

   public void setStr(short str) {
/*  229 */     if (str < 0) {
/*  230 */       str = 0;
     }
/*  232 */     this.str = str;
   }

   public short getDex() {
/*  236 */     return (short)(this.dex + this.nirvanaFlame.getNdex());
   }

   public short getAloneDex() {
/*  240 */     return this.dex;
   }

   public void setDex(short dex) {
/*  244 */     if (dex < 0) {
/*  245 */       dex = 0;
     }
/*  247 */     this.dex = dex;
   }

   public short getInt() {
/*  251 */     return (short)(this._int + this.nirvanaFlame.getNint());
   }

   public short getAloneInt() {
/*  255 */     return this._int;
   }

   public void setInt(short _int) {
/*  259 */     if (_int < 0) {
/*  260 */       _int = 0;
     }
/*  262 */     this._int = _int;
   }

   public short getLuk() {
/*  266 */     return (short)(this.luk + this.nirvanaFlame.getNluk());
   }

   public short getAloneLuk() {
/*  270 */     return this.luk;
   }

   public void setLuk(short luk) {
/*  274 */     if (luk < 0) {
/*  275 */       luk = 0;
     }
/*  277 */     this.luk = luk;
   }

   public short getHp() {
/*  281 */     return (short)(this.hp + this.nirvanaFlame.getNhp());
   }

   public short getAloneHp() {
/*  285 */     return this.hp;
   }

   public void setHp(short hp) {
/*  289 */     if (hp < 0) {
/*  290 */       hp = 0;
     }
/*  292 */     this.hp = hp;
   }

   public short getMp() {
/*  296 */     return (short)(this.mp + this.nirvanaFlame.getNmp());
   }

   public short getAloneMp() {
/*  300 */     return this.mp;
   }

   public void setMp(short mp) {
/*  304 */     if (mp < 0) {
/*  305 */       mp = 0;
     }
/*  307 */     this.mp = mp;
   }

   public short getWatk() {
/*  311 */     return (short)(this.watk + this.nirvanaFlame.getNwatk());
   }

   public short getAloneWatk() {
/*  315 */     return this.watk;
   }


   public void setWatk(short watk) {
/*  320 */     if (watk < 0) {
/*  321 */       watk = 0;
     }
/*  323 */     this.watk = watk;
   }

   public short getMatk() {
/*  327 */     return (short)(this.matk + this.nirvanaFlame.getNmatk());
   }

   public short getAloneMatk() {
/*  331 */     return this.matk;
   }

   public void setMatk(short matk) {
/*  335 */     if (matk < 0) {
/*  336 */       matk = 0;
     }
/*  338 */     this.matk = matk;
   }

   public short getWdef() {
/*  342 */     return (short)(this.wdef + this.nirvanaFlame.getNwdef());
   }

   public short getAloneWdef() {
/*  346 */     return this.wdef;
   }

   public void setWdef(short wdef) {
/*  350 */     if (wdef < 0) {
/*  351 */       wdef = 0;
     }
/*  353 */     this.wdef = wdef;
   }

   public short getMdef() {
/*  357 */     return (short)(this.mdef + this.nirvanaFlame.getNmdef());
   }

   public short getAloneMdef() {
/*  361 */     return this.mdef;
   }

   public void setMdef(short mdef) {
/*  365 */     if (mdef < 0) {
/*  366 */       mdef = 0;
     }
/*  368 */     this.mdef = mdef;
   }

   public short getAcc() {
/*  372 */     return (short)(this.acc + this.nirvanaFlame.getNacc());
   }

   public short getAloneAcc() {
/*  376 */     return this.acc;
   }

   public void setAcc(short acc) {
/*  380 */     if (acc < 0) {
/*  381 */       acc = 0;
     }
/*  383 */     this.acc = acc;
   }

   public short getAvoid() {
/*  387 */     return (short)(this.avoid + this.nirvanaFlame.getNavoid());
   }

   public short getAloneAvoid() {
/*  391 */     return this.avoid;
   }

   public void setAvoid(short avoid) {
/*  395 */     if (avoid < 0) {
/*  396 */       avoid = 0;
     }
/*  398 */     this.avoid = avoid;
   }

   public short getHands() {
/*  402 */     return (short)(this.hands + this.nirvanaFlame.getNhands());
   }

   public short getAloneHands() {
/*  406 */     return this.hands;
   }

   public void setHands(short hands) {
/*  410 */     if (hands < 0) {
/*  411 */       hands = 0;
     }
/*  413 */     this.hands = hands;
   }

   public short getSpeed() {
/*  417 */     return (short)(this.speed + this.nirvanaFlame.getNspeed());
   }

   public short getAloneSpeed() {
/*  421 */     return this.speed;
   }

   public void setSpeed(short speed) {
/*  425 */     if (speed < 0) {
/*  426 */       speed = 0;
     }
/*  428 */     this.speed = speed;
   }

   public short getJump() {
/*  432 */     return (short)(this.jump + this.nirvanaFlame.getNjump());
   }

   public short getAloneJump() {
/*  436 */     return this.jump;
   }


   public void setJump(short jump) {
/*  441 */     if (jump < 0) {
/*  442 */       jump = 0;
     }
/*  444 */     this.jump = jump;
   }

   public byte getLevel() {
/*  448 */     return this.level;
   }

   public void setLevel(byte level) {
/*  452 */     this.level = level;
   }

   public byte getViciousHammer() {
/*  456 */     return this.vicioushammer;
   }

   public void setViciousHammer(byte ham) {
/*  460 */     this.vicioushammer = ham;
   }

   public long getItemEXP() {
/*  464 */     return this.itemEXP;
   }

   public void setItemEXP(long itemEXP) {
/*  468 */     if (itemEXP < 0L) {
/*  469 */       itemEXP = 0L;
     }
/*  471 */     this.itemEXP = itemEXP;
   }

   public long getEquipExp() {
/*  475 */     if (this.itemEXP <= 0L) {
/*  476 */       return 0L;
     }

/*  479 */     if (ItemConstants.isWeapon(getItemId())) {
/*  480 */       return this.itemEXP / 700000L;
     }
/*  482 */     return this.itemEXP / 350000L;
   }


   public long getEquipExpForLevel() {
/*  487 */     if (getEquipExp() <= 0L) {
/*  488 */       return 0L;
     }
/*  490 */     long expz = getEquipExp();
/*  491 */     for (int i = getBaseLevel(); i <= GameConstants.getMaxLevel(getItemId()) && 
/*  492 */       expz >= GameConstants.getExpForLevel(i, getItemId()); i++) {
/*  493 */       expz -= GameConstants.getExpForLevel(i, getItemId());
     }



/*  498 */     return expz;
   }

   public long getExpPercentage() {
/*  502 */     if (getEquipLevel() < getBaseLevel() || getEquipLevel() > GameConstants.getMaxLevel(getItemId()) || GameConstants.getExpForLevel(getEquipLevel(), getItemId()) <= 0) {
/*  503 */       return 0L;
     }
/*  505 */     return getEquipExpForLevel() * 100L / GameConstants.getExpForLevel(getEquipLevel(), getItemId());
   }

   public int getEquipLevel() {
/*  509 */     int fixLevel = 0;
/*  510 */     Map<String, Integer> equipStats = MapleItemInformationProvider.getInstance().getItemBaseInfo(getItemId());
/*  511 */     if (equipStats.containsKey("fixLevel")) {
/*  512 */       fixLevel = ((Integer)equipStats.get("fixLevel")).intValue();
     }

/*  515 */     if (GameConstants.getMaxLevel(getItemId()) <= 0) {
/*  516 */       return fixLevel;
     }

/*  519 */     int levelz = getBaseLevel() + fixLevel;
/*  520 */     if (getEquipExp() <= 0L) {
/*  521 */       return levelz;
     }
/*  523 */     long expz = getEquipExp();
/*  524 */     for (int i = levelz; i < GameConstants.getMaxLevel(getItemId()) && 
/*  525 */       expz >= GameConstants.getExpForLevel(i, getItemId()); i++) {
/*  526 */       levelz++;
/*  527 */       expz -= GameConstants.getExpForLevel(i, getItemId());
     }



/*  532 */     return levelz;
   }

   public int getBaseLevel() {
/*  536 */     return (GameConstants.getStatFromWeapon(getItemId()) == null) ? 1 : 0;
   }


   public void setQuantity(short quantity) {
/*  541 */     if (quantity < 0 || quantity > 1) {
/*  542 */       throw new RuntimeException("设置装备的数量错误 欲设置的数量： " + quantity + " (道具ID: " + getItemId() + ")");
     }
/*  544 */     super.setQuantity(quantity);
   }




   public int getDurability() {
/*  551 */     return this.durability;
   }

   public void setDurability(int dur) {
/*  555 */     this.durability = dur;
   }




   public byte getEnhance() {
/*  562 */     return this.enhance;
   }

   public void setEnhance(byte en) {
/*  566 */     this.enhance = en;
   }

   public int getPotential(int pos, boolean add) {
/*  570 */     switch (pos) {
       case 1:
/*  572 */         if (add) {
/*  573 */           return this.potential4;
         }
/*  575 */         return this.potential1;

       case 2:
/*  578 */         if (add) {
/*  579 */           return this.potential5;
         }
/*  581 */         return this.potential2;

       case 3:
/*  584 */         if (add) {
/*  585 */           return this.potential6;
         }
/*  587 */         return this.potential3;
     }

/*  590 */     return 0;
   }

   public void setPotential(int potential, int pos, boolean add) {
/*  594 */     switch (pos) {
       case 1:
/*  596 */         if (add) {
/*  597 */           this.potential4 = potential;
           break;
         }
/*  600 */         this.potential1 = potential;
         break;

       case 2:
/*  604 */         if (add) {
/*  605 */           this.potential5 = potential;
           break;
         }
/*  608 */         this.potential2 = potential;
         break;

       case 3:
/*  612 */         if (add) {
/*  613 */           this.potential6 = potential;
           break;
         }
/*  616 */         this.potential3 = potential;
         break;
     }
   }




   public int getPotential1() {
/*  625 */     return this.potential1;
   }

   public void setPotential1(int en) {
/*  629 */     this.potential1 = en;
   }




   public int getPotential2() {
/*  636 */     return this.potential2;
   }

   public void setPotential2(int en) {
/*  640 */     this.potential2 = en;
   }




   public int getPotential3() {
/*  647 */     return this.potential3;
   }

   public void setPotential3(int en) {
/*  651 */     this.potential3 = en;
   }




   public int getPotential4() {
/*  658 */     return this.potential4;
   }

   public void setPotential4(int en) {
/*  662 */     this.potential4 = en;
   }




   public int getPotential5() {
/*  669 */     return this.potential5;
   }

   public void setPotential5(int en) {
/*  673 */     this.potential5 = en;
   }




   public int getPotential6() {
/*  680 */     return this.potential6;
   }

   public void setPotential6(int en) {
/*  684 */     this.potential6 = en;
   }










   public byte getState(boolean add) {
/*  697 */     if (add) {
/*  698 */       return this.addState;
     }
/*  700 */     return this.state;
   }

   public void setState(byte en, boolean add) {
/*  704 */     if (add) {
/*  705 */       this.addState = en;
     } else {
/*  707 */       this.state = en;
     }
   }

   public void initAllState() {
/*  712 */     initState(false);
/*  713 */     initState(true);
   }

   public void initState(boolean useAddPot) {
/*  717 */     int n2, n3, n4, n = 0;



/*  721 */     if (!useAddPot) {
/*  722 */       n2 = this.potential1;
/*  723 */       n3 = this.potential2;
/*  724 */       n4 = this.potential3;
     } else {
/*  726 */       n2 = this.potential4;
/*  727 */       n3 = this.potential5;
/*  728 */       n4 = this.potential6;
     }
/*  730 */     if (n2 >= 40000 || n3 >= 40000 || n4 >= 40000) {
/*  731 */       n = 20;
/*  732 */     } else if (n2 >= 30000 || n3 >= 30000 || n4 >= 30000) {
/*  733 */       n = 19;
/*  734 */     } else if (n2 >= 20000 || n3 >= 20000 || n4 >= 20000) {
/*  735 */       n = 18;
/*  736 */     } else if (n2 >= 1 || n3 >= 1 || n4 >= 1) {
/*  737 */       n = 17;
/*  738 */     } else if (n2 == -20 || n3 == -20 || n2 == -4 || n3 == -4) {
/*  739 */       n = 4;
/*  740 */     } else if (n2 == -19 || n3 == -19 || n2 == -3 || n3 == -3) {
/*  741 */       n = 3;
/*  742 */     } else if (n2 == -18 || n3 == -18 || n2 == -2 || n3 == -2) {
/*  743 */       n = 2;
/*  744 */     } else if (n2 == -17 || n3 == -17 || n2 == -1 || n3 == -1) {
/*  745 */       n = 1;
/*  746 */     } else if (n2 < 0 || n3 < 0 || n4 < 0) {
       return;
     }
/*  749 */     setState((byte)n, useAddPot);
   }


   public void resetPotential_Fuse(boolean half, int potentialState) {
/*  754 */     potentialState = -potentialState;
/*  755 */     if (Randomizer.nextInt(100) < 4) {
/*  756 */       potentialState -= (Randomizer.nextInt(100) < 4) ? 2 : 1;
     }
/*  758 */     setPotential1(potentialState);
/*  759 */     setPotential2((Randomizer.nextInt(half ? 5 : 10) == 0) ? potentialState : 0);
/*  760 */     setPotential3(0);
/*  761 */     initState(false);
   }

   public void renewPotential(boolean add) {
/*  765 */     renewPotential(0, add);
   }

   public void renewPotential(int rank, boolean add) {
/*  769 */     renewPotential(rank, false, add);
   }

   public void renewPotential(boolean b, boolean add) {
/*  773 */     renewPotential(0, b, add);
   }

   public void renewPotential(int rank, boolean b, boolean add) {
     int state;
/*  778 */     switch (rank) {
       case 1:
/*  780 */         state = -17;
         break;

       case 2:
/*  784 */         state = -18;
         break;

       case 3:
/*  788 */         state = -19;
         break;

       case 4:
/*  792 */         state = -20;
         break;

       default:
/*  796 */         state = (Randomizer.nextInt(100) < 4) ? ((Randomizer.nextInt(100) < 4) ? -19 : -18) : -17;
         break;
     }

/*  800 */     boolean b3 = ((getState(add) != 0 && getPotential(3, add) != 0) || b);
/*  801 */     setPotential(state, 1, add);
/*  802 */     setPotential((Randomizer.nextInt(10) <= 1 || b3) ? state : 0, 2, add);
/*  803 */     setPotential(0, 3, add);
/*  804 */     initState(add);
   }

   public void renewPotential_A() {
/*  808 */     setPotential(-18, 1, false);
/*  809 */     setPotential((Randomizer.nextInt(1000) <= 100) ? -18 : 0, 2, false);
/*  810 */     setPotential(0, 3, false);
/*  811 */     initState(false);
   }

   public void renewPotential_S() {
/*  815 */     setPotential(-19, 1, false);
/*  816 */     setPotential((Randomizer.nextInt(1000) <= 50) ? -19 : 0, 2, false);
/*  817 */     setPotential(0, 3, false);
/*  818 */     initState(false);
   }

   public boolean resetPotential(int itemid, MapleCharacter player, int lockslot, short lockid) {
/*  822 */     if (player.getInventory(MapleInventoryType.EQUIP).getNumFreeSlot() >= 1) {
       long meso;
/*  824 */       int flag = ItemConstants.PotentialConstants.getDefaultPotentialFlag(itemid);
/*  825 */       boolean bl2 = ItemConstants.PotentialConstants.PotentialFlag.附加潜能.check(flag);
/*  826 */       if (!ItemConstants.PotentialConstants.canUse(this, itemid) || (itemid == 2711002 && !JobConstants.is神之子(player.getJob()))) {
/*  827 */         player.dropMessage(5, "你无法对这个物品使用这个魔方。");
/*  828 */         return false;
       }
/*  830 */       int rate = CubeConfig.INSTANCE.getChance(itemid, getState(bl2) - 16);
/*  831 */       switch (itemid) {
         case 5062009:
         case 5062010:
         case 5062022:
         case 5062500:
         case 5062501:
         case 5062502:
         case 5062503:
/*  839 */           meso = ItemConstants.getCubeNeedMeso(this);
/*  840 */           if (player.getMeso() >= meso) {
/*  841 */             player.gainMeso(-meso, false);
             break;
           }
/*  844 */           player.dropMessage(5, "您没有足够的金币。");
/*  845 */           player.sendEnableActions();
/*  846 */           return false;
       }

/*  849 */       switch (itemid) {
         case 5062000:
         case 5062009:
         case 5062010:
         case 5062500:
/*  854 */           if (ServerConfig.WORLD_REMOVE_CUBECHIP) {
/*  855 */             if (!player.haveItem(4009453, 1)) {
/*  856 */               player.dropMessage(5, "为了激活魔方需要有一个魔方的精髓！");
/*  857 */               return false;
             }
/*  859 */             player.removeItem(4009453, 1);
           }
           break;
       }
/*  863 */       if (getState(bl2) >= 17 && getState(bl2) <= 20) {
         Item item;
/*  865 */         switch (itemid) {
           case 5062010:
           case 5062090:
           case 5062503:
/*  869 */             savePotentialInfo(player, flag, player.isAdmin() ? 999 : rate, itemid);
             break;

           default:
/*  873 */             item = player.getInventory(MapleInventoryType.CASH).findById(5067000);
/*  874 */             if (lockslot > 0) {
/*  875 */               if (item == null) {
/*  876 */                 return false;
               }
/*  878 */               MapleInventoryManipulator.removeById(player.getClient(), MapleInventoryType.CASH, item.getPosition(), 1, false, true);
             }
/*  880 */             randNewState(player.isAdmin() ? 999 : rate, flag, lockslot);
/*  881 */             switch (itemid) {
               case 5062024:
/*  883 */                 updateSxuanState(player);
                 break;


               case 2710000:
               case 2710001:
               case 2710002:
               case 2710003:
               case 2711000:
               case 2711001:
               case 2711002:
               case 2711003:
               case 2711004:
               case 2711005:
               case 2711006:
               case 2711007:
               case 2711008:
               case 2711009:
               case 5062009:
               case 5062022:
               case 5062500:
               case 5062501:
               case 5062502:
/*  906 */                 resetPotential(player, flag, itemid);
                 break;
             }
             break;
         }
/*  911 */         player.forceUpdateItem(this);
/*  912 */         if (bl2) {
/*  913 */           player.getMap().broadcastMessage(InventoryPacket.潜能变化效果(player.getId(), true, itemid));
         } else {
/*  915 */           player.getMap().broadcastMessage(InventoryPacket.showPotentialReset(false, player.getId(), true, itemid, getItemId()));
         }
/*  917 */         int debris = ItemConstants.PotentialConstants.getCubeDebris(itemid);
/*  918 */         if (debris > 0) {
/*  919 */           MapleInventoryManipulator.addById(player.getClient(), debris, (short)1, "Cube on " + DateUtil.getCurrentDate());
         }
/*  921 */         return true;
       }
/*  923 */       player.dropMessage(5, "请确认您要重置的道具具有潜能属性。");
     }
/*  925 */     return false;
   }

   public void updateSxuanState(MapleCharacter player) {
/*  929 */     int n2 = (getPotential(2, false) != 0) ? 6 : 4;
/*  930 */     List<StructItemOption> arrayList = randPotential(n2);
/*  931 */     player.updateOneInfo(52998, "dst", String.valueOf(getPosition()));
/*  932 */     player.getClient().announce(InventoryPacket.showHyunPotentialResult(false, n2 / 2, arrayList));
   }

   public void resetPotential(MapleCharacter player, int flag, int itemid) {
/*  936 */     boolean check = ItemConstants.PotentialConstants.PotentialFlag.附加潜能.check(flag);
/*  937 */     ItemScrollHandler.ItemPotentialAndMagnify(this, player, false);
/*  938 */     initState(check);
/*  939 */     player.send(InventoryPacket.showCubeResult(player.getId(), itemid, getPosition(), player.getItemQuantity(itemid) - 1, copy()));
   }

   public void savePotentialInfo(MapleCharacter player, int flag, int rate, int itemid) {
/*  943 */     Equip nEquip = (Equip)copy();
/*  944 */     nEquip.randNewState(rate, flag, 0);
/*  945 */     boolean bl2 = ItemConstants.PotentialConstants.PotentialFlag.附加潜能.check(flag);
/*  946 */     int n5 = (getPotential(2, bl2) != 0) ? 3 : 2;
/*  947 */     nEquip.setStateMsg(3);
/*  948 */     ItemScrollHandler.ItemPotentialAndMagnify(nEquip, player, false);
/*  949 */     player.updateInfoQuest(52889, "dst=-1;Pot0=-1;Pot1=-1;Pot2=-1;add=0");
/*  950 */     for (int i2 = 0; i2 < n5; i2++) {
/*  951 */       player.updateOneInfo(52889, "Pot" + i2, String.valueOf(nEquip.getPotential(i2 + 1, bl2)));
     }
/*  953 */     player.updateOneInfo(52889, "dst", String.valueOf(getPosition()));
/*  954 */     player.updateOneInfo(52889, "add", ItemConstants.PotentialConstants.PotentialFlag.附加潜能.check(flag) ? "1" : "0");

/*  956 */     player.send(InventoryPacket.showCubeResetResult(getPosition(), nEquip, itemid, player.getItemQuantity(itemid) - 1, player.getInventory(MapleInventoryType.CASH).findById(itemid).getPosition()));
   }

   public List<StructItemOption> randPotential(int n2) {
/*  960 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/*  961 */     int reqLevel = ii.getReqLevel(getItemId()) / 10;
/*  962 */     reqLevel = (reqLevel >= 20) ? 19 : reqLevel;
/*  963 */     int newState = getState(false) + 16;
/*  964 */     if (newState > 20 || newState < 17) {
/*  965 */       newState = 17;
     }
/*  967 */     List<List<StructItemOption>> linkedList = ii.getFilterPotentials();
/*  968 */     int oldstate = Math.abs(getPotential(3, false));
/*  969 */     List<StructItemOption> ret = new ArrayList<>(6);
/*  970 */     for (int i2 = 1; i2 <= n2; i2++) {
/*  971 */       boolean add = false;
/*  972 */       while (!add) {
/*  973 */         StructItemOption itemOption = ((List<StructItemOption>)linkedList.get(Randomizer.nextInt(linkedList.size()))).get(reqLevel);
/*  974 */         if (itemOption == null || 
/*  975 */           GameConstants.isAboveA(itemOption.opID) || 
/*  976 */           !GameConstants.optionTypeFits(itemOption.optionType, getItemId()) || 
/*  977 */           !GameConstants.isBlockedPotential(this, itemOption.opID, false, ItemConstants.PotentialConstants.PotentialFlag.点券光环.check(oldstate)) || 
/*  978 */           !GameConstants.potentialIDFits(itemOption.opID, newState, ItemConstants.PotentialConstants.PotentialFlag.对等.check(oldstate) ? 1 : i2) || (ItemConstants.PotentialConstants.PotentialFlag.去掉无用潜能
/*  979 */           .check(oldstate) && (
/*  980 */           !ItemConstants.PotentialConstants.PotentialFlag.去掉无用潜能.check(oldstate) || ItemConstants.PotentialConstants.checkProperties(itemOption))))
           continue;
/*  982 */         ret.add(itemOption);
/*  983 */         add = true;
       }
     }
/*  986 */     return ret;
   }



















   public void randNewState(int defaultRate, int flag, int lockSlot) {
       int rate = 1;
       boolean add = ItemConstants.PotentialConstants.PotentialFlag.附加潜能.check(flag);
       boolean three = getPotential(3, add) > 0;
       int randnum = Randomizer.nextInt(1000);
       int newState = randnum < defaultRate * rate ? 1 : 0;
       if ((ItemConstants.PotentialConstants.PotentialFlag.等级下降.check(flag)) && (newState == 0)) {
           newState = Randomizer.nextInt(1000) < (defaultRate + 200) * rate ? -1 : 0;
       }
       if (ItemConstants.PotentialConstants.PotentialFlag.前两条相同.check(flag)) {
           flag -= (Randomizer.nextInt(10) <= 5 ? ItemConstants.PotentialConstants.PotentialFlag.前两条相同.getValue() : 0);
       }
       if (getState(add) + newState >= 17) { if (getState(add) + newState <= (ItemConstants.PotentialConstants.PotentialFlag.A级.check(flag) ? 18 : ItemConstants.PotentialConstants.PotentialFlag.S级.check(flag) ? 19 : ItemConstants.PotentialConstants.PotentialFlag.SS级.check(flag) ? 20 : 17)) {}
       } else { newState = 0;
       }

       setState((byte)(getState(add) + newState - 16), add);
       if ((lockSlot != 0) && (lockSlot <= 3)) {
           setPotential(-(lockSlot * 100000 + getPotential(lockSlot, add)), 1, add);
       } else {
           setPotential(-getState(add), 1, add);
       }
       if (ItemConstants.PotentialConstants.PotentialFlag.调整潜能条数.check(flag)) {
           setPotential(Randomizer.nextInt(10) <= 2 ? -getState(add) : 0, 2, add);
       } else if (three) {
           setPotential(-getState(add), 2, add);
       } else {
           setPotential(0, 2, add);
       }
       setPotential(-flag, 3, add);
       if (ItemConstants.PotentialConstants.PotentialFlag.洗后无法交易.check(flag)) {
           setFlag((short)(getFlag() | ItemFlag.不可交易.getValue()));
       }
       initState(add);

   }


















   public int getIncSkill() {
/* 1029 */     return this.incSkill;
   }

   public void setIncSkill(int inc) {
/* 1033 */     this.incSkill = inc;
   }




   public short getCharmEXP() {
/* 1040 */     return this.charmExp;
   }

   public void setCharmEXP(short s) {
/* 1044 */     this.charmExp = s;
   }




   public short getPVPDamage() {
/* 1051 */     return this.pvpDamage;
   }

   public void setPVPDamage(short p) {
/* 1055 */     this.pvpDamage = p;
   }




   public MapleRing getRing() {
/* 1062 */     if (!ItemConstants.isEffectRing(getItemId()) || getUniqueId() <= 0) {
/* 1063 */       return null;
     }
/* 1065 */     if (this.ring == null) {
/* 1066 */       this.ring = MapleRing.loadFromDb(getUniqueId(), (getPosition() < 0));
     }
/* 1068 */     return this.ring;
   }

   public void setRing(MapleRing ring) {
/* 1072 */     this.ring = ring;
   }




   public MapleAndroid getAndroid() {
/* 1079 */     if (getItemId() / 10000 != 166 || getUniqueId() <= 0) {
/* 1080 */       return null;
     }
/* 1082 */     if (this.android == null) {
/* 1083 */       this.android = MapleAndroid.loadFromDb(getItemId(), getUniqueId());
     }
/* 1085 */     return this.android;
   }

   public void setAndroid(MapleAndroid ring) {
/* 1089 */     this.android = ring;
   }




   public int getStateMsg() {
/* 1096 */     return this.statemsg;
   }

   public void setStateMsg(int en) {
/* 1100 */     if (en >= 3) {
/* 1101 */       this.statemsg = 3;
/* 1102 */     } else if (en < 0) {
/* 1103 */       this.statemsg = 0;
     } else {
/* 1105 */       this.statemsg = en;
     }
   }








   public short getSocketState() {
/* 1117 */     short flag = 0;
/* 1118 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 1119 */     boolean isSocketItem = (ServerConfig.WORLD_ALLOWED_ALLEQUIP_SOCKET || !ii.isCash(getItemId()));
/* 1120 */     if (isSocketItem) {
/* 1121 */       flag = (short)(flag | SocketFlag.可以镶嵌.getValue());
/* 1122 */       if (this.socket1 == -1 && isSocketItem) {
/* 1123 */         setSocket1(0);
       }
/* 1125 */       if (this.socket1 != -1) {
/* 1126 */         flag = (short)(flag | SocketFlag.已打孔01.getValue());
       }
/* 1128 */       if (this.socket2 != -1) {
/* 1129 */         flag = (short)(flag | SocketFlag.已打孔02.getValue());
       }
/* 1131 */       if (this.socket3 != -1) {
/* 1132 */         flag = (short)(flag | SocketFlag.已打孔03.getValue());
       }
/* 1134 */       if (this.socket1 > 0) {
/* 1135 */         flag = (short)(flag | SocketFlag.已镶嵌01.getValue());
       }
/* 1137 */       if (this.socket2 > 0) {
/* 1138 */         flag = (short)(flag | SocketFlag.已镶嵌02.getValue());
       }
/* 1140 */       if (this.socket3 > 0) {
/* 1141 */         flag = (short)(flag | SocketFlag.已镶嵌03.getValue());
       }
     }
/* 1144 */     return flag;
   }

   public int getSocket1() {
/* 1148 */     return this.socket1;
   }

   public void setSocket1(int socket) {
/* 1152 */     this.socket1 = socket;
   }

   public int getSocket2() {
/* 1156 */     return this.socket2;
   }

   public void setSocket2(int socket) {
/* 1160 */     this.socket2 = socket;
   }

   public int getSocket3() {
/* 1164 */     return this.socket3;
   }

   public void setSocket3(int socket) {
/* 1168 */     this.socket3 = socket;
   }




   public int getItemSkin() {
/* 1175 */     return this.itemSkin;
   }

   public void setItemSkin(int id) {
/* 1179 */     this.itemSkin = id;
   }




   public short getEnhanctBuff() {
/* 1186 */     return this.enhanctBuff;
   }

   public void setEnhanctBuff(short enhanctBuff) {
/* 1190 */     if (enhanctBuff < 0) {
/* 1191 */       enhanctBuff = 0;
     }
/* 1193 */     this.enhanctBuff = enhanctBuff;
   }

   public short getReqLevel() {
/* 1197 */     return this.reqLevel;
   }

   public void setReqLevel(short reqLevel) {
/* 1201 */     if (reqLevel < 0) {
/* 1202 */       reqLevel = 0;
     }
/* 1204 */     this.reqLevel = reqLevel;
   }

   public short getYggdrasilWisdom() {
/* 1208 */     return this.yggdrasilWisdom;
   }

   public void setYggdrasilWisdom(short yggdrasilWisdom) {
/* 1212 */     if (yggdrasilWisdom < 0) {
/* 1213 */       yggdrasilWisdom = 0;
     }
/* 1215 */     this.yggdrasilWisdom = yggdrasilWisdom;
   }

   public boolean getFinalStrike() {
/* 1219 */     return this.finalStrike;
   }

   public void setFinalStrike(boolean finalStrike) {
/* 1223 */     this.finalStrike = finalStrike;
   }

   public short getBossDamage() {
/* 1227 */     return (short)(this.bossDamage + this.nirvanaFlame.getNbossDamage());
   }

   public void setBossDamage(short bossDamage) {
/* 1231 */     if (bossDamage < 0) {
/* 1232 */       bossDamage = 0;
     }
/* 1234 */     this.bossDamage = bossDamage;
   }

   public short getIgnorePDR() {
/* 1238 */     return (short)(this.ignorePDR + this.nirvanaFlame.getNignorePDR());
   }

   public void setIgnorePDR(short ignorePDR) {
/* 1242 */     if (ignorePDR < 0) {
/* 1243 */       ignorePDR = 0;
     }
/* 1245 */     this.ignorePDR = ignorePDR;
   }




   public short getTotalDamage() {
/* 1252 */     return (short)(this.totalDamage + this.nirvanaFlame.getNtotalDamage());
   }

   public void setTotalDamage(short totalDamage) {
/* 1256 */     if (totalDamage < 0) {
/* 1257 */       totalDamage = 0;
     }
/* 1259 */     this.totalDamage = totalDamage;
   }

   public short getAllStat() {
/* 1263 */     return (short)(this.allStat + this.nirvanaFlame.getNallStat());
   }

   public void setAllStat(short allStat) {
/* 1267 */     if (allStat < 0) {
/* 1268 */       allStat = 0;
     }
/* 1270 */     this.allStat = allStat;
   }

   public short getKarmaCount() {
/* 1274 */     return this.karmaCount;
   }

   public void setKarmaCount(short karmaCount) {
/* 1278 */     this.karmaCount = karmaCount;
   }

   public Map<EquipStats, Long> getStatsTest() {
/* 1282 */     return this.statsTest;
   }




   public int getEquipFlag() {
/* 1289 */     int flag = 0;
/* 1290 */     if (getUpgradeSlots() > 0) {
/* 1291 */       flag |= EquipStats.可升级次数.getValue();
     }
/* 1293 */     if (getLevel() > 0) {
/* 1294 */       flag |= EquipStats.已升级次数.getValue();
     }
/* 1296 */     if (getStr() > 0) {
/* 1297 */       flag |= EquipStats.力量.getValue();
     }
/* 1299 */     if (getDex() > 0) {
/* 1300 */       flag |= EquipStats.敏捷.getValue();
     }
/* 1302 */     if (getInt() > 0) {
/* 1303 */       flag |= EquipStats.智力.getValue();
     }
/* 1305 */     if (getLuk() > 0) {
/* 1306 */       flag |= EquipStats.运气.getValue();
     }
/* 1308 */     if (getHp() > 0) {
/* 1309 */       flag |= EquipStats.Hp.getValue();
     }
/* 1311 */     if (getMp() > 0) {
/* 1312 */       flag |= EquipStats.Mp.getValue();
     }
/* 1314 */     if (getWatk() > 0) {
/* 1315 */       flag |= EquipStats.物攻.getValue();
     }
/* 1317 */     if (getMatk() > 0) {
/* 1318 */       flag |= EquipStats.魔攻.getValue();
     }
/* 1320 */     if (getWdef() > 0) {
/* 1321 */       flag |= EquipStats.物防.getValue();
     }









/* 1332 */     if (getHands() > 0) {
/* 1333 */       flag |= EquipStats.手技.getValue();
     }
/* 1335 */     if (getSpeed() > 0) {
/* 1336 */       flag |= EquipStats.速度.getValue();
     }
/* 1338 */     if (getJump() > 0) {
/* 1339 */       flag |= EquipStats.跳跃.getValue();
     }
/* 1341 */     if (getFlag() > 0) {
/* 1342 */       flag |= EquipStats.状态.getValue();
     }
/* 1344 */     if (getIncSkill() > 0) {
/* 1345 */       flag |= EquipStats.技能.getValue();
     }
/* 1347 */     if (isSealedEquip()) {
/* 1348 */       if (getSealedLevel() > 0) {
/* 1349 */         flag |= EquipStats.道具等级.getValue();
       }
/* 1351 */       if (getSealedExp() > 0L) {
/* 1352 */         flag |= EquipStats.道具经验.getValue();
       }
     } else {
/* 1355 */       if (getEquipLevel() > 0) {
/* 1356 */         flag |= EquipStats.道具等级.getValue();
       }
/* 1358 */       if (getExpPercentage() > 0L) {
/* 1359 */         flag |= EquipStats.道具经验.getValue();
       }
     }
/* 1362 */     if (getDurability() > 0) {
/* 1363 */       flag |= EquipStats.耐久度.getValue();
     }
/* 1365 */     if (getViciousHammer() > 0) {
/* 1366 */       flag |= EquipStats.金锤子.getValue();
     }
/* 1368 */     if (getPVPDamage() > 0) {
/* 1369 */       flag |= EquipStats.大乱斗攻击力.getValue();
     }
/* 1371 */     if (getEnhanctBuff() > 0) {
/* 1372 */       flag |= EquipStats.ENHANCT_BUFF.getValue();
     }
/* 1374 */     if (getiIncReq() > 0) {
/* 1375 */       flag |= EquipStats.REQUIRED_LEVEL.getValue();
     }
/* 1377 */     if (getYggdrasilWisdom() > 0) {
/* 1378 */       flag |= EquipStats.YGGDRASIL_WISDOM.getValue();
     }
/* 1380 */     if (getFinalStrike()) {
/* 1381 */       flag |= EquipStats.FINAL_STRIKE.getValue();
     }
/* 1383 */     if (getBossDamage() > 0) {
/* 1384 */       flag |= EquipStats.BOSS伤害.getValue();
     }
/* 1386 */     if (getIgnorePDR() > 0) {
/* 1387 */       flag |= EquipStats.无视防御.getValue();
     }
/* 1389 */     return flag;
   }






















   public int getEquipSpecialFlag() {
/* 1414 */     int flag = 0;
/* 1415 */     if (getTotalDamage() > 0) {
/* 1416 */       flag |= EquipStats.总伤害.getValue();
     }
/* 1418 */     if (getAllStat() > 0) {
/* 1419 */       flag |= EquipStats.全属性.getValue();
     }
/* 1421 */     flag |= EquipStats.剪刀次数.getValue();

/* 1423 */     if (getFire() > 0L) {
/* 1424 */       flag |= EquipStats.涅槃火焰.getValue();
     }
/* 1426 */     if (getItemState() > 0) {
/* 1427 */       flag |= EquipStats.星级.getValue();
     }
/* 1429 */     return flag;
   }






   public long getLimitBreak() {
/* 1438 */     return this.limitBreak;
   }

   public void setLimitBreak(long lb) {
/* 1442 */     this.limitBreak = lb;
   }

   public long getLimitBreakEx() {
/* 1446 */     return this.limitBreakEx;
   }

   public void setLimitBreakEx(long limitBreakEx) {
/* 1450 */     this.limitBreakEx = limitBreakEx;
   }

   public long getTotalLimitBreak() {
/* 1454 */     return this.limitBreak + this.limitBreakEx;
   }

   public void setLockPotential(int slot, short id) {
/* 1458 */     this.lockSlot = slot;
/* 1459 */     this.lockId = id;
   }

   public int getLockSlot() {
/* 1463 */     return this.lockSlot;
   }

   public int getLockId() {
/* 1467 */     return this.lockId;
   }

   public boolean isSealedEquip() {
/* 1471 */     return GameConstants.isSealedEquip(getItemId());
   }

   public byte getSealedLevel() {
/* 1475 */     return this.sealedLevel;
   }

   public void setSealedLevel(byte level) {
/* 1479 */     this.sealedLevel = level;
   }

   public void gainSealedExp(long gain) {
/* 1483 */     this.sealedExp += gain;
   }

   public long getSealedExp() {
/* 1487 */     return this.sealedExp;
   }

   public void setSealedExp(long exp) {
/* 1491 */     this.sealedExp = exp;
   }

   public short getSoulName() {
/* 1495 */     return this.soulname;
   }

   public void setSoulName(short soulname) {
/* 1499 */     this.soulname = soulname;
   }

   public short getSoulEnchanter() {
/* 1503 */     return this.soulenchanter;
   }

   public void setSoulEnchanter(short soulenchanter) {
/* 1507 */     this.soulenchanter = soulenchanter;
   }

   public short getSoulPotential() {
/* 1511 */     return this.soulpotential;
   }

   public void setSoulPotential(short soulpotential) {
/* 1515 */     this.soulpotential = soulpotential;
   }

   public int getSoulSkill() {
/* 1519 */     return this.soulSkill;
   }

   public void setSoulSkill(int skillid) {
/* 1523 */     this.soulSkill = skillid;
   }

   public int getiIncReq() {
/* 1527 */     return this.iIncReq;
   }

   public NirvanaFlame getNirvanaFlame() {
/* 1531 */     return this.nirvanaFlame;
   }

   public void setNirvanaFlame(NirvanaFlame nirvanaFlame) {
/* 1535 */     this.nirvanaFlame = nirvanaFlame;
   }

   public long getFire() {
/* 1539 */     return this.fire;
   }

   public void setFire(long fire) {
/* 1543 */     this.fire = fire;
   }

   public int getNeedStar() {
/* 1547 */     return Math.max((getEnhance() <= 18) ? (100 - getEnhance() * 5) : (10 - (getEnhance() - 18) * 2), 1);
   }

   public boolean getStartCurse() {
/* 1551 */     MapleItemInformationProvider ii = MapleItemInformationProvider.getInstance();
/* 1552 */     boolean bl2 = ii.isSuperiorEquip(getItemId());
/* 1553 */     int n2 = StarForceConfig.START_CURSE;
/* 1554 */     return (getEnhance() > n2 || (bl2 && getEnhance() > n2 / 3));
   }

   public boolean getStartDown() {
/* 1558 */     int n2 = StarForceConfig.START_DOWN;
/* 1559 */     return (n2 > 0 && getEnhance() >= n2 && getEnhance() % 5 != 0);
   }

   public boolean getBonusTime() {
/* 1563 */     int bonus_time = StarForceConfig.BONUS_TIME;
/* 1564 */     return (bonus_time > 0 && getBonus() >= bonus_time);
   }

   public int getBonus() {
/* 1568 */     return this.bonus;
   }

   public void setBonus(int bonus) {
/* 1572 */     this.bonus = bonus;
   }

   public short getARC() {
/* 1576 */     return this.ARC;
   }

   public void setARC(short ARC) {
/* 1580 */     this.ARC = ARC;
   }

   public void gainARC(short ARC) {
/* 1584 */     this.ARC = (short)(this.ARC + ARC);
   }

   public int getARCExp() {
/* 1588 */     return this.ARCExp;
   }

   public void setARCExp(int ARCExp) {
/* 1592 */     this.ARCExp = ARCExp;
   }

   public void gainARCExp(int ARCExp) {
/* 1596 */     this.ARCExp += ARCExp;
   }

   public short getARCLevel() {
/* 1600 */     return this.ARCLevel;
   }

   public void setARCLevel(short ARCLevel) {
/* 1604 */     this.ARCLevel = ARCLevel;
   }

   public void gainARCLevel(short ARCLevel) {
/* 1608 */     this.ARCLevel = (short)(this.ARCLevel + ARCLevel);
   }

   public int getItemState() {
/* 1612 */     return this.itemState;
   }

   public void setItemState(int itemState) {
/* 1616 */     this.itemState = itemState;
   }









   public enum ScrollResult
   {
/* 1629 */     失败, 成功, 消失;
   }
 }

